package com.viphuli.app.tool.handler;

import java.util.Arrays;


import com.offroader.utils.ViewUtils;
import com.viphuli.app.tool.bean.page.CircleInfoPage;
import com.viphuli.app.tool.bean.part.AccountUser;
import com.viphuli.app.tool.common.AccessTokenKeeper;
import com.viphuli.app.tool.fragment.CircleCreateFragment;

public class CircleCreateHandler extends MyBaseHttpResponseHandler<CircleCreateFragment, CircleInfoPage>{

	@Override
	public void deal() {
		
		int circleId = page.getCircleInfo().getCircleId();
		
		AccessTokenKeeper tokenKeeper = AccessTokenKeeper.readAccessToken(caller.getActivity());
		
		AccountUser user = tokenKeeper.getUser();
		user.setCircleList(Arrays.asList(circleId));
		
		AccessTokenKeeper.keepAccessToken(caller.getActivity(), tokenKeeper);
		
		ViewUtils.toast(page.getResultMsg());
		caller.getActivity().finish();
	
	}

}

